home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / cb / usage.c < prev    next >
C/C++ Source or Header  |  1996-07-19  |  1KB  |  62 lines

  1.  
  2. #include "cb.h"
  3.  
  4. void usage()
  5. {
  6.     preusage();
  7.  
  8.     printf("Where:\n"
  9.        "    -l: optional flag to log the defaults to '%s'.\n"
  10.        "\n"
  11.        "    action: Action to be taken. Select from:\n"
  12.        "        disable        : disables mgetty's dial-in\n"
  13.            "        enable        : resets callback to waiting state\n"
  14.            "        file        : shows mgetty's definition file\n"
  15.            "        init        : restarts init to reload mgetty\n"
  16.        "%s"
  17.        "%s"
  18.        , get_logfilename()
  19.        , getmode() == mode_callback ?
  20.         "        list [who]        : lists user-related information\n"
  21.         :
  22.         ""
  23.         , getmode() == mode_callback ?
  24.         "        state        : shows state of callback\n"
  25.         :
  26.         ""
  27.     );
  28.  
  29.     if (getmode() == mode_callback)
  30.     printf
  31.     (
  32.            "        %swho where%s  : forces callback to 'who' at 'where'\n"
  33.        , getcall() ? "call " : ""
  34.        , getcall() ? "" : "     "
  35.     );
  36.  
  37.     printf(
  38.            "\n"
  39.            "    line: - the tty-line to use. Recognized lines are:\n"
  40.        "        ttyS1--ttyS9, 1--9, + (use all configured lines).\n"
  41.        "          - If omitted, the default line is used.\n"
  42.        "          - Ignored with 'init'%s.\n"
  43.        "\n"
  44.         , getmode() == mode_callback ?
  45.             ", 'list', and 'who'"
  46.         :
  47.             ""
  48.        );
  49.  
  50.     error
  51.     (
  52.     "%s: %s MODE\n"
  53.     "Actions may be abbreviated, e.g., \"in\" is equivalent to "
  54.                                   " \"init\".\n"
  55.     , getprogname()
  56.     , getmode() == mode_callback ?
  57.         "CALLBACK"
  58.         :
  59.         "DIAL-IN"
  60.     );
  61. }
  62.